#include "../../elastic.h"

const std::string index_name = "student";
const std::string url = "http://elastic:123456@192.168.194.128:9200/";


void create(const biteics::ESClient::ptr& client)
{
    biteics::Indexer indexer(index_name);
    indexer.tokenizer("ikmax");
    auto name = indexer.field("name");
    name->analyzer("ikmax");
    name->boost(2.0);
    indexer.field("phone")->type("keyword");
    indexer.field("age")->type("integer");
    indexer.field("skills")->type("text");
    indexer.field("birth")->type("date");
    indexer.field("birth")->index("false");
    auto res = client->create(indexer);
    if (res == false) {
        return ;
    }
}

